
/*
 *  <   little-endian, std. size & alignment
    >   big-endian, std. size & alignment
    t   descript    C Type      Standard size
    x   pad byte    -           -
    c   char        char        1
    b   byte        int8_t      1
    B   Byte        uint8_t     1
    ?   boolean     _Bool       1
    w   word        int16_t     2
    W   Word        uint16_t    2
    i   int         int32_t     4
    I   Int         uint32_t    4
    l   long        int64_t     8
    L   Long        uint64_t    8
    f   float       float       4
    d   double      double      8
    s   string      char[]      n
    p   pointer     char[]      n
    P   Pointer     void *      N
    &   refrence    -           -
 **/
#ifndef _HAVE_STRUCT_H
#define _HAVE_STRUCT_H

#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif

extern int32_t struct_pack(uint8_t *buf, const char *fmt, ...);
extern int32_t struct_pack_into(int32_t offset,
                                uint8_t *buf, const char *fmt, ...);
extern int32_t struct_unpack(uint8_t *buf, const char *fmt, ...);
extern int32_t struct_unpack_from(int32_t offset,
                                  uint8_t *buf, const char *fmt, ...);
extern int32_t struct_calcsize(const char *fmt);

#ifdef __cplusplus
}
#endif

#endif /* _HAVE_STRUCT_H */
